package at.fhhagenberg.hydrac;

import java.io.IOException;
import java.util.logging.Logger;

import at.fhhagenberg.hydrac.backend.codegenerators.AbstractCodeGenerator;
import at.fhhagenberg.hydrac.backend.codegenerators.AstCodeGenerator;
import at.fhhagenberg.hydrac.backend.javacc.nodes.ASTStart;

/**
 * Java Cross Compiler
 * 
 * @author Thomas Fischl
 */
public class AstCompiler extends Compiler {

  public AstCompiler(Logger logger) {
    super(logger);
  }

  private final String fileExt = "xml";

  @Override
  protected AbstractCodeGenerator getCodeGenerator(String fileName, ASTStart ast, int nrOfSpaces) throws IOException {
    return new AstCodeGenerator(fileName, ast, nrOfSpaces, out);
  }

  @Override
  protected String getLanguageExt() {
    return fileExt;
  }

}
